class Student:
    def __init__(self, name, age):
        self.name = name
        self.age = age

    def print(self):
        print(self.name, self.age)


stu1 = Student('yinsc', 18)
stu2 = Student('zhumq', 16)

stu1.print()
stu2.print()

print('-' * 40)

# 动态绑定属性
stu2.gender = '男'
print(stu2.name, stu2.age, stu2.gender)

print('-' * 40)

def say():
    print('动态绑定方法被运行了..')

# 动态绑定方法,以赋值的形式进行动态绑定
stu1.func1=say
# 运行动态绑定的方法
stu1.func1()